﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true" CodeFile="Frequency.aspx.cs" Inherits="Frequency"meta:resourcekey="PageResource1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<title>التردد</title>
 <link href="jqModal.css" rel="stylesheet" type="text/css" />

  <%--  <script src="jquery-1.3.2.min.js" type="text/javascript"></script>--%>
    <script src="jqModal.js" type="text/javascript"></script>
   
    <script type="text/javascript">
  

    function there() {

        $("#dialog").jqm({ modal: true }).jqmShow();


    }
   
    </script>
      <style type="text/css">
         .newzr3{
	background:  url('images/Untitled-2_03.png') right ;

	height:34px;
	 background-repeat:no-repeat;
	 float:left;
	 margin-top:-5px;
	 text-align: center;
	 padding-right:15px;
	 cursor:pointer;
	 font-family:Tahoma;
	 font-size:14px;
	 color:#003353;
	 text-decoration:none;
	 
}
.newzr3:hover{
	color: #00b4ff;
	background-image:url('images/Untitled-2ho_03.png');
	background-repeat:no-repeat;

}
        	.zr3 {
	background-image:url('images/button2.png');
	display:block;
	float:right;
	 padding: 0px 10px 0px 10px;
	height:21px;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 0px #003a5e;
	margin-right:2px;
	line-height:19px;
	font-weight:bold;
	text-decoration:none;
	font-family:Tahoma;
	font-size:12px;


}
.zr3:hover ,.zr3:active {
	background-image:url('images/button2.png');
	text-shadow:1px 1px 0px #003a5e;
	background-position:0px -21px;
	
}
  .stylelabel3
       {
       	color:#064c66;
	 font-weight:bold;
	 direction:rtl;
	 text-align:right;
       	}
             .tab3{
	width:815px;
 direction:rtl;
 border:1px #ccc solid;
 border-radius:5px;
 }

tr .tabbone3{
	 background-color:#028ac5;
	 font-size:11px;
	 line-height:20px;
	 font-family:Tahoma;
  	 color:#fff;
  	 text-align:center;
	
}
 .req3
       {
           color:Red;
       } 
.adel3{
	background-color:#ededed;
	font-size:10px;
	color:#084f86;
	font-family:Tahoma;
	height:30px;
	text-align:  center;
}
.he3{
	background-color:#fff;
	padding:5px;
	font-family:Tahoma;
	font-size:14px;
	font-weight:bold;
}
        

        .jqmWindow {
    display: none;
    
    position: fixed;
    top: 30%;
    left: 50%;
    
    margin-left: -300px;
    width: 400px;
    
    background-color: #FFF;
    color: #333;
    border: 1px solid black;
    padding: 12px;
}
.txt3
{
    border:1px solid black;
    margin-bottom:5px;
    margin-top:5px;
    }
.jqmOverlay { background-color: #000; }

/* Fixed posistioning emulation for IE6
     Star selector used to hide definition from browsers other than IE6
     For valid CSS, use a conditional include instead */
* html .jqmWindow 
{
     position: absolute;
     top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
            </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<br />
<div id="addedit" runat="server" align="left"> 

<table style="width:100%">
<tr>
<td style="padding:5px">

    <asp:LinkButton CssClass="newzr3" style="float:left;" ID="newsub" runat="server"  Text="تردد جديد"  
        meta:resourceKey="newsub"  onclick="newsub_Click" Height="19" ></asp:LinkButton>
</td>
</tr>
</table>
    
</div>
<div class="jqmWindow" id="dialog">

<a href="#" class="jqmClose" style="background-image:url('images/close.png');
	 width:39px;
	 height:40px;
	  background-repeat:no-repeat;
	  display:block;
	  float:left;	"></a>

     <table   dir="rtl">
     
     <tr>
     <td style="width:100px;">
         <asp:Label style="float:right" CssClass="stylelabel3"  ID="lblpaidfees" runat="server" Text="التردد" meta:resourceKey="lblpaidfees" />
    </td>
<%--<td> <asp:Label CssClass="Lablcss"  ID="lblendsub" runat="server" Text="نهاية الاشتراك" meta:resourceKey="lblendsub" /></td>--%>
<td colspan ="2"> 
     <asp:TextBox ID="paidfees" runat="server" CssClass="txt3"></asp:TextBox></td>
   
             <td> &nbsp;</td>
             </tr><tr>
             <td style="width:100px;">
     
          <asp:Label CssClass="stylelabel3"  ID="lblsatrtsub" runat="server" Text="العـــــــــدد" meta:resourceKey="lblsatrtsub" />
     
     </td>
      <td>
          <asp:TextBox ID="numerics" Width="50px" CssClass="txt3" runat="server"></asp:TextBox>
          
       </td>
      <td>
           <asp:DropDownList ID="DropDownList1" runat="server" CssClass="txt3">
               <asp:ListItem Value="w">اسابيع</asp:ListItem>
               <asp:ListItem Value="m">شهور</asp:ListItem>
               <asp:ListItem Value="d">ايام</asp:ListItem>
               <asp:ListItem Value="y">سنين</asp:ListItem>
          
           
           </asp:DropDownList>
          
          <asp:FilteredTextBoxExtender ID="numerics_FilteredTextBoxExtender" 
              runat="server" Enabled="True" FilterType="Numbers" TargetControlID="numerics">
          </asp:FilteredTextBoxExtender>
          
      </td>
      
      <td>
          &nbsp;</td>
          </tr>
          <tr>
          <td></td>
          <td colspan="3">
          <asp:Button   CssClass="zr3" ID="save" runat="server" Text="حفظ" onclick="save_Click" meta:resourceKey="lblsave"  />
          </td>
          </tr>
          </table>
     </div>
     
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="select frequencies.nodays,frequencies.type, frequencies.freq, frequencies.id , count(products.freq_id) as ps from frequencies left join products on frequencies.id=products.freq_id group by frequencies.nodays,frequencies.type, frequencies.freq, frequencies.id">
    </asp:SqlDataSource>
    
    <asp:GridView ID="GridView1" runat="server" 
        DataSourceID="SqlDataSource1" 
        AutoGenerateColumns="False" DataKeyNames="id" 
        onrowdatabound="GridView1_RowDataBound" Font-Size="Large" GridLines="None">
        <Columns>
        
        
                <asp:TemplateField>
                            <HeaderTemplate>
                            <div >
                                <table class="tab3"   >

                                    <tr>
                                    <td class="tabbone3" style="width:200px">
                                        <asp:Label ID="lblpaidfees" runat="server" Text="التردد" meta:resourceKey="lblpaidfees" />
                                            
                                        </td>
                                        <td class="tabbone3" style="width:200px" >
                                     <asp:Label ID="lblstartofsubs" runat="server" Text="العــــدد" meta:resourceKey="lblstartofsubs" />
                                            
                                        </td>
                                         
                                        <td class="tabbone3" style="width:100px">
                                     <asp:Label  ID="lblstops" runat="server" Text="تعديل" meta:resourceKey="lblstop" />
                                            
                                        </td>


                                    <td class="tabbone3"style="width:100px">
                                     <asp:Label ID="lblendofsubs" runat="server" Text="مسح" meta:resourceKey="lblendofsubs" />
                                            
                                        </td>
                                    
                                  
                                     
                                     
                                        
                                      
                                    </tr>
                                </table>
                                </div>
                            </HeaderTemplate>
                            <ItemTemplate>
                              
                             
                                    <table class="tab3">
                                        <tr>
                                         <td class="adel3" style="width:200px">
                                                <asp:Label  ID="paidfees" runat="server" ToolTip='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("ps"))) %>' Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("freq"))) %>' />
                                            </td>
                                            <td class="adel3"style="width:100px">
                                                <asp:Label ID="startofsub" runat="server" ToolTip='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("nodays"))) %>' Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("nodays"))) %>' />
                                            </td>
                                            <td class="adel3"style="width:100px">
                                                <asp:Label  ID="types" runat="server" ToolTip='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("type"))) %>' Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("type"))) %>' />
                                            </td>
                                         <td class="adel3"style="width:100px">
                                             <asp:LinkButton runat="server" ID="edits" Text='تعديل' meta:resourceKey="lbledit"  ToolTip='<%# Eval("id") %>' OnClick="edit_Click" Enabled="true" />
                                            </td>
                                                  <td class="adel3"style="width:100px">
                                               <asp:LinkButton runat="server" ID="delete" Text='حذف' meta:resourceKey="lbldel"  ToolTip='<%# Eval("id") %>' OnClick="delete_Click" Enabled="true" />
                                            </td>

                                        
                                           
                                        </tr>
                                    </table>
                                      <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" 
                        TargetControlID="delete" 
                        ConfirmText=".هل انت متأكد من  مسح االنوع؟؟؟" 
                          />
                                    </ItemTemplate>
                </asp:TemplateField>
      
        </Columns>
    </asp:GridView>
  
</asp:Content>
